<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="<%=basePath %>res/wsz/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="<%=basePath %>res/wsz/js/base.js"></script>
<title>我的订单页面</title>
<script type="text/javascript">
	$(function() {
	    //默认加载数据
	    loadData(null);
	});
	
	function loadData(data) {
	    var url = "<%=basePath %>fodIndent/selectAll";
	    var data = data;
	    $("#tb").html("");
	    $.post(url, data, function(mes) {
	        $.each(mes, function(index, item) {
	            $("#tb").append("<tr><td id='sj'>" + formatDate(item.optime,'yyyy-MM-dd hh:mm:ss') + "</td><td>订单号:" + item.indentName + "<p>商家名称:"+ item.merchantName +"</p></td><td>" + item.indentPrice + "</td><td>" + item.pay + "  "+ item.dis + "<td><a href='javascript:showIndent(\""+item.indentId+"\");'><button type='button' class='btn btn-primary'>订单详情</button></td></tr>");
	        });
	    }, "json");
	}
	function showIndent(indentId){
		sessionStorage['indentId'] = indentId;
		location.href="pages/wsz/qiantai/FodDetail.jsp";
	}
	
</script>
<style>
	span{
		margin-left:20px;
	}
	table{
		margin-top:30px;
	}
	table th{
		background:#EDEDED;
		width:200px;
		height:30px;
		text-align:center;
	}
	table td{
		width:200px;
		height:50px;
		text-align:center;
		line-height:40px;
	}
	button{
		background:#fff;
		border:1px solid #ccc;
		color:#333;
	}
	button:hover{
		border:1px solid #3F96FD;
		color:#3F96FD;
	}
	#sj{
		width:100px;
		padding:0px 30px 0px;
	}
</style>
</head>
<body>
	<div>
		<div>
			<h3><span>近三个月订单</span></h3>
		</div>
		<hr />
		<div>
			<table border="0" cellspacing="0" cellpadding="0">
				<thead>
					<tr> 
						<th>下单时间</th>
						<th>订单内容</th>
						<th>支付金额(元)</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody id="tb">
				
				</tbody>
			</table>
			<ul class="pagination">
		
			</ul>
		</div>
	</div>
</body>
</html>